<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator"
	prefix="decorator"%>
<%@ taglib uri="http://www.opensymphony.com/sitemesh/page" prefix="page"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	if(session.getAttribute("usuario")==null){
		out.print("<script>window.location= '/knowledge/callLogin'</script>");
	}
 %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
	<head>
		<title><decorator:title default="Knowledge" /></title>
		<s:url value="/js/jquery/superfish/css/superfish.css" var="cssFish"></s:url>
		<link rel="stylesheet" type="text/css" href="${cssFish}"
			media="screen">
		<s:url value="/css/smoothness/jquery-ui-1.8.2.custom.css"
			var="cssSmooth"></s:url>
		<link type="text/css" href="${cssSmooth}" rel="stylesheet" />
		<s:url value="/js/jquery/jquery-1.6.4.min.js" var="jsJQuery"></s:url>
		<script type="text/javascript" src="${jsJQuery}">
</script>
		<s:url value="/js/jquery-ui-1.8.2.custom.min.js" var="jsJQueryUi"></s:url>
		<script type="text/javascript" src="${jsJQueryUi}">
</script>
		<s:url value="/js/jquery.centreIt-min-1.1.2.js" var="jsCenterIt"></s:url>
		<script type="text/javascript" src="${jsCenterIt}">
</script>
		<s:url value="/js/jquery/superfish/js/hoverIntent.js" var="jsHover"></s:url>
		<script type="text/javascript" src="${jsHover}">
</script>
		<s:url value="/js/jquery/superfish/js/superfish.js" var="jsSuper"></s:url>
		<script type="text/javascript" src="${jsSuper}">
</script>
		<script type="text/javascript">
// initialise plugins
jQuery(function() {
	jQuery('ul.sf-menu').superfish();
});

function displayLoading() {
	$("#loading").show();
	$("#loading").CenterIt();
	$(".loadingImage").show();
	$(".loadingImage").CenterIt();
}

$(document).ready(function() {
	$("#idLogout").click(function() {
		if (!confirm("Deseja realmente efetuar Logout?")) {
			return false;
		}
	});

	$("form").submit(function() {
		displayLoading();
	});
	$("#loading").hide();
	$(".loadingImage").CenterIt();
	$(".loadingImage").hide();
});
</script>

		<s:url value="/css/style.css" var="cssLayout"></s:url>
		<link rel="stylesheet" type="text/css" href="${cssLayout}">
		<STYLE type="text/css">
.loading {
	width: 110%;
	height: 100%;
	position: absolute;
	top: 0;
	left: 0;
	background-color: black;
	filter: alpha(opacity =   40);
	-moz-opacity: 0.4;
	-khtml-opacity: 0.4;
	opacity: 0.4;
	z-index: 1001;
}

.loadingImage {
	z-index: 1002;
	color: black;
	position: absolute;
	width: 300px;
	height: 300px;
	display: none;
	margin: 0 auto;
	left: 500px;
}

.loadingMsg {
	font-size: 13px;
	font-weight: bolder;
	left: 500px;
}
</STYLE>
		<decorator:head />
	</head>
	<body>
		<div style="clear: all;"></div>
		<div id="loading" class="loading"></div>
		<div class="loadingImage">
			<s:url value="/images/2.gif" var="loadImg"></s:url>
			<img src="${loadImg}">
			<br />
			<span class="loadingMsg"> Carregando... </span>
		</div>

		<div id="page-holder">
			<div id="login-info">
				<div id="login-menu">
					Usuário: ${sessionScope.usuario.nmusuario} |
					<s:url value="logout" var="doLogout">
					</s:url>
					<a href="${doLogout}" id="idLogout">Logout</a>
				</div>
			</div>
			<div id="header">
				<div style="float: left;">
					<h1 class="logo">
						Knowledge
					</h1>
					<h3 class="sub-logo">
						conhecimento ao seu favor
					</h3>
				</div>
				<div style="clear: both;"></div>
				<ul class="sf-menu">
					<li class="current">
						<s:url value="/pagina-inicial" var="inicial"></s:url>
						<a href="${inicial}">Início</a>
					</li>
					<c:if test="${sessionScope.usuario.indadministrador}">
						<li>
							<a href="#b">Administrador</a>
							<ul>
								<li>
									<s:url value="/lista-usuario" var="listarUsuarios"></s:url>
									<a href="${listarUsuarios}">Usu&aacute;rio</a>
								</li>
								<!--
								<li>
									<s:url value="/lista-funcao" var="listarFuncoes"></s:url>
									<a href="${listarFuncoes}">Fun&ccedil;&otilde;es</a>
								</li>
								-->
								<li>
									<s:url value="/listar-projeto" var="listarProjetos"></s:url>
									<a href="${listarProjetos}">Projeto</a>
								</li>
								<li>
									<s:url value="/listar-linguagem" var="listarLinguagem"></s:url>
									<a href="${listarLinguagem}">Linguagem</a>
								</li>
								<li>
									<s:url value="/lista-tiposgdb" var="listarTipoSGDB"></s:url>
									<a href="${listarTipoSGDB}">Tipos SGDB</a>
								</li>
								<li>
									<s:url value="/listar-user-to-proj" var="listarUserProj"></s:url>
									<a href="${listarUserProj}">Usuário x Projeto</a>
								</li>
							</ul>
						</li>
					</c:if>
					<li>
						<a href="#c">Cargas Projeto</a>
						<ul>
							<li>
								<a href="#banco">Banco</a>
								<ul>
									<li>
									<li>
										<s:url value="/chamar-cadastro-tabela" var="cadastrarTabela"></s:url>
										<a href="${cadastrarTabela}">Tabelas</a>
									</li>
									<li>
										<s:url value="/chamar-cadastro-coluna"
											var="cadastrarColunaLote"></s:url>
										<a href="${cadastrarColunaLote}">Colunas</a>
									</li>
									<!--
										<li>
											<s:url value="/cadastra-storedprocedure" var="cargaStoredProcedure"></s:url>
											<a href="${cargaStoredProcedure}">Carga Stored Procedures</a>
										</li>
									-->
							</li>
						</ul>
					</li>
					<li>
						<a href="#codigo">Código</a>
						<ul>
							<li>
								<s:url value="/chama-loadfiles" var="loadFiles"></s:url>
								<a href="${loadFiles}">Fonte</a>
							</li>
						</ul>
					</li>
				</ul>
				</li>
				<li>
					<a href="#c">Consultas</a>
					<ul>
						<li>
							<s:url value="/chamar-filtro-consulta" var="callNewConsult"></s:url>
							<a href="${callNewConsult}">Consultar Relacionamentos</a>
						</li>

						<li>
							<a href="#listar">Listar</a>
							<ul>
								<li>
									<s:url value="/listar-tabela" var="listarTabela"></s:url>
									<a href="${listarTabela}">Tabelas</a>
								</li>
								<li>
									<s:url value="/filtrar-tabelascolunas"
										var="listartabelascolunas"></s:url>
									<a href="${listartabelascolunas}">Colunas</a>
								</li>
								<li>
									<s:url value="/listar-fontes" var="listarfontes"></s:url>
									<a href="${listarfontes}">Códigos Fonte</a>
								</li>
							</ul>
						</li>
					</ul>
				</li>
				<li>
					<a href="#help">Ajudas</a>
					<ul>
						<li>
							<s:url value="/help-suport" var="helpSuport"></s:url>
							<a href="${helpSuport}">Ajuda</a>
							<s:url value="/help-sobre" var="helpSobre"></s:url>
							<a href="${helpSobre}">Sobre</a>
						</li>
					</ul>
				</li>
				</ul>
			</div>
			<s:if
				test="hasActionErrors() || hasActionMessages() || hasFieldErrors()">
				<div style="margin-bottom: 5px;">
					<s:if test="hasActionErrors() || hasFieldErrors()">
						<div class="ui-state-error ui-corner-all"
							style="margin-top: 8px; margin-bottom: 5px;">
							<div style="margin-top: 10px; font-size: 10px;">
								<s:iterator value="actionErrors">
									<p style="display: block">
										<span class="ui-icon ui-icon-alert"
											style="float: left; margin-left: 5px; margin-right: .3em;"></span>
										<span class="actionMessage"><s:property escape="false" />
										</span>
									</p>
								</s:iterator>
								<s:if test="hasFieldErrors()">
									<p>
										<span class="ui-icon ui-icon-alert"
											style="float: left; margin-left: 5px; margin-right: .3em;"></span>
										<span style="top: 2px; position: relative;">Os
											seguintes erros foram econtrados:</span>
										<span class="actionMessage"><s:fielderror /> </span>
									</p>
								</s:if>
							</div>
						</div>
					</s:if>
					<s:if test="hasActionMessages()">
						<div class="ui-state-highlight ui-corner-all"
							style="margin-top: 8px; margin-bottom: 5px;">
							<div style="margin-top: 10px; font-size: 10px;">
								<s:iterator value="actionMessages">
									<p>
										<span class="ui-icon ui-icon-info"
											style="float: left; margin-left: 5px; margin-right: .3em;"></span>
										<span class="actionMessage"><s:property escape="false" />
										</span>
									</p>
								</s:iterator>
							</div>
						</div>
					</s:if>
				</div>
			</s:if>
			<div id="body" style="height: 73.5%;">
				<decorator:body />
			</div>
			<div id="footer">
				<p style="height: 30px; margin-top: 5px">
					Copyright 2012 - Knowledge
				</p>
			</div>
		</div>
	</body>
</html>